﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Text;
using System.Threading.Tasks;
using ParkingApp.Lib;

namespace ParkingApp.Service.ConsoleHost
{
    class Program
    {
        static void Main(string[] args)
        {
            Uri baseAddress = new Uri("http://localhost:8080/ParkingAppService");
            using (ServiceHost host = new ServiceHost(typeof(Parking), baseAddress)) {
                var smb = new ServiceMetadataBehavior();
                smb.HttpGetEnabled = true;
                smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
                host.Description.Behaviors.Add(smb);
                host.Open();

                Console.WriteLine("Service started. Press <Enter> to stop service.");
                Console.ReadLine();
                host.Close();
            }
        }
    }
}

